/*
 * @Author: qinuoyun
 * @Date:   2019-12-03 17:08:13
 * @Last Modified by:   sean
 * @Last Modified time: 2019-12-09 17:43:15
 */
class basics {
  constructor(vnode) {
    let vm = vnode.context;
    this.instance = vm;
    this.config = vm.value;
    this.parent = vm.$parent ? vm.$parent.value : null;
    this.slot = vm.value.location ? vm.value.location : 0;
  }

  getID() {
    return 'VM_' + this.instance._uid;
  }

  getUID() {
    return this.instance._uid;
  }

  getParent() {
    return this.parent;
  }

  getConfig() {
    return this.config;
  }

  getParentEl() {
    if (this.parent) {
      return this.parent.element;
    }
    return false
  }

  getElement() {
    return this.vm.$el;
  }

  getSlot() {
    return this.slot;
  }
}
export default basics;
